from typing import List


class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        index_map = {}
        for index, number in enumerate(nums):
            index_map[number] = index

        for index, number in enumerate(nums):
            another = index_map.get(target - number)
            if another and another != index:
                return [index, another]

        return []


Solution().twoSum([2, 7, 11, 15], 9)
